package example.collections;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Created by lenovo on 2016/11/7 0007.
 * 元素替换
 */
public class Replace {
    public static void main(String[] args) {
        List<String> list = Arrays.asList("one Two three Four five six one three Four".split(" "));
        System.out.println("List :" + list);
        //替换指定的元素数据
        Collections.replaceAll(list, "one", "hundred");
        System.out.println("replaceAll: " + list);
    }
}
